home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / passmakr.arc / PASSWORD.BAS (.txt)
Encoding:
GW-BASIC  |  1987-03-28  |  2.4 KB  |  94 lines

  1. 100  ' This program will help you choose PASSWORDS for logging on bulletin boards
  2. 110  ' This program was put together in about 5 minutes, so there may be a few
  3. 120  ' bugs in the character generating subroutines.  However, for the most part,
  4. 130  ' you should be able to get passwords that are random enough to deter any
  5. 140  ' guessing work on the part of a hacker.
  6. 150  ' I always seem to have trouble getting a random number within a certain
  7. 160  ' range.  Let's see, does it go INT(RND*30)+29 or INT(RND*29)+30???!!!???!!!
  8. 170  ' No matter!  It seems to work well enough!
  9. 180  ' Written under the influence of too much modeming by J. Richard Dale
  10. 190  ' Co-sysop of the Penn Valley Community College Bulletin Board System of
  11. 200  ' Kansas City, Missouri.  (816)932-7687, 8pm to 8am, 4pm Fridays to
  12. 210  ' 8am Mondays, 24 hours on holidays
  13. 220  '
  14. 230  '
  15. 240  '
  16. 250  ' If you use this program, please consider a contribution in the form of
  17. 260  ' an upload to the Penn Valley BBS.  Or secondly to Johnson County BBS
  18. 270  ' (913)469-3831 or (931)469-3832, 24 hours
  19. 280  '
  20. 290  '
  21. 300  '
  22. 310  CLS:KEY OFF
  23. 320  INPUT "How many passwords do you want to generate? ",A:CLS:DIM PW$(A)
  24. 330  INPUT "How many characters do you want in the password? ",B:CLS
  25. 340  PRINT "Do you want:":PRINT
  26. 350  PRINT "1 - Letters only"
  27. 360  PRINT "2 - Numbers only"
  28. 370  PRINT "3 - Letters and numbers"
  29. 380  PRINT "4 - Letters and characters
  30. 390  PRINT "5 - Numbers and characters
  31. 400  PRINT "6 - Letters, Numbers and characters
  32. 410  PRINT:PRINT "Press a key corresponding to your choice"
  33. 420  A$=INKEY$:IF A$="" THEN 420
  34. 430  Z=VAL(A$):IF Z<1 OR Z>6 THEN 420
  35. 440  CLS:PRINT "Working.....please stand by"
  36. 450  FOR LOOP=1 TO A
  37. 460  FOR LOOPA=1 TO B
  38. 470  ON Z GOSUB 600,670,740,830,920,990
  39. 480  PW$(LOOP)=PW$(LOOP)+A$
  40. 490  NEXT:NEXT
  41. 500  FOR LOOP=1 TO A
  42. 510  PRINT PW$(LOOP)
  43. 520  NEXT
  44. 530  PRINT "That completes the list of passwords."
  45. 540  END
  46. 550  '
  47. 560  '
  48. 570  '
  49. 580  '
  50. 590  ' To pick letters only
  51. 600  RANDOMIZE TIMER
  52. 610  A$=CHR$(INT(RND*25)+65)
  53. 620  RETURN
  54. 630  '
  55. 640  '
  56. 650  '
  57. 660  ' To pick letters only
  58. 670  RANDOMIZE TIMER
  59. 680  A$=CHR$(INT(RND*9)+48)
  60. 690  RETURN
  61. 700  '
  62. 710  '
  63. 720  '
  64. 730  ' To pick letters and numbers
  65. 740  RANDOMIZE TIMER
  66. 750  Q=(INT(RND*42)+48)
  67. 760  IF Q>=58 AND Q<=64 THEN 750
  68. 770  A$=CHR$(Q)
  69. 780  RETURN
  70. 790  '
  71. 800  '
  72. 810  '
  73. 820  ' To pick letters and characters
  74. 830  RANDOMIZE TIMER
  75. 840  Q=(INT(RND*62)+33)
  76. 850  IF Q>=48 AND Q<=57 THEN 840
  77. 860  A$=CHR$(Q)
  78. 870  RETURN
  79. 880  '
  80. 890  '
  81. 900  '
  82. 910  ' To pick numbers and characters
  83. 920  RANDOMIZE TIMER
  84. 930  A$=CHR$(INT(RND*31)+33)
  85. 940  RETURN
  86. 950  '
  87. 960  '
  88. 970  '
  89. 980  ' To pick letters, numbers and characters
  90. 990  RANDOMIZE TIMER
  91. 1000  Q=(INT(RND*62)+33)
  92. 1010  A$=CHR$(Q)
  93. 1020  RETURN
  94.